import 'package:azlistview/azlistview.dart';
import 'package:fish_redux/fish_redux.dart';
import 'package:json_annotation/json_annotation.dart';

part 'city_info.g.dart';

@JsonSerializable()
class CityInfo extends ISuspensionBean with Cloneable<CityInfo> {
  String name;
  String tagIndex;
  String namePinyin;

  @override
  @JsonKey(defaultValue: false)
  bool isShowSuspension;

  CityInfo({
    this.name,
    this.tagIndex,
    this.namePinyin,
  });

  factory CityInfo.fromJson(Map<String, dynamic> json) =>
      _$CityInfoFromJson(json);

  Map<String, dynamic> toJson() => _$CityInfoToJson(this);

  @override
  String getSuspensionTag() => tagIndex;

  @override
  String toString() => "CityInfo {" + " \"name\":\"" + name + "\"" + '}';

  @override
  CityInfo clone() {
    return CityInfo(
      name: name,
      namePinyin: namePinyin,
      tagIndex: tagIndex,
    )..isShowSuspension = isShowSuspension;
  }
}
